package com.freework.report.xmlreport.groupBean.dao;

public class CreateSQLBuiderBeanNotGroup extends CreateSQLBuiderBean {
	public String bilidSQL(String byname1,String tableName,String where,DBCol[] cols){
		String byname=byname1==null?tableName:byname1;
		StringBuilder sql=new StringBuilder(36+cols.length*50+tableName.length()+where.length());
		sql.append("select ");
		for (int i = 0; i < cols.length; i++) {
			if(i!=0)
				sql.append(",");
				sql.append(getColName(byname,cols[i].getName()));
			}
		sql.append(" from ").append(tableName);
		if(byname1!=null)
			sql.append(" ").append(byname1);
		if(!where.equals("")){
			sql.append(" where ").append(where);
		}
			sql.append(" ${thisWhereReplace} ");

			
		return sql.toString();
	}
}
